﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core.Primitives
{
    public static class Helper
    {
        public static bool OnOneLine(SinglePoint p0, SinglePoint p1, SinglePoint p2)
        {
            // | x0 y0 1 |
            // | x1 y1 1 | = 0 => true
            // | x2 y2 1 |

            float det = p0.X * p1.Y + p0.Y * p2.X + p1.X * p2.Y
                - (p1.Y * p2.X + p0.Y * p1.X + p0.X * p2.Y);

            return det == 0f;
        }
    }
}
